import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

export default {
  install(router) {
    router.beforeEach((to, from, next) => {
      NProgress.start()
      next()
    })
    
    router.afterEach(() => {
      NProgress.done()
    })
    
    // 配置NProgress
    NProgress.configure({
      showSpinner: false,
      trickleSpeed: 200
    })
  }
}